package zjut.cocouml.figure;

import org.eclipse.draw2d.ColorConstants;
import org.eclipse.draw2d.Ellipse;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.LineBorder;
import org.eclipse.draw2d.Shape;
import org.eclipse.draw2d.ToolbarLayout;
import org.eclipse.draw2d.XYLayout;
import org.eclipse.draw2d.geometry.Rectangle;

public class BUseCaseFigure extends Figure{
	
	private LabelName caseName = new LabelName();
	
	public BUseCaseFigure () {
		
		XYLayout layout = new XYLayout();
		this.setLayoutManager(layout);
		Shape ellipse = new Ellipse();
		ellipse.setSize(80, 40);
		
		this.setOpaque(true);		
		this.add(ellipse);
		this.setConstraint(ellipse, new Rectangle(0,0,80,40));
		caseName.setSize(80, 20);
		this.add(caseName);
		this.setConstraint(caseName, new Rectangle(0,40,80,20));
		
	}

	public void setLabelName(String name) {
		this.caseName.setName(name);
	}
	public String getLabelName() {
		return this.caseName.getName();
	}
	public void setLayout(Rectangle rect) {
		getParent().setConstraint(this, rect);
	}
}